Skip to content

solver: fix on-demand CDI device resolution - #7293

Merged
tonistiigi merged 2 commits into
moby:masterfrom
crazy-max:fix-cdi-on-demand-resolution
Oct 21, 2026
Merged

tonistiigi merged 2 commits into
moby:masterfrom
crazy-max:fix-cdi-on-demand-resolution

Conversation

@crazy-max

Copy link
Copy Markdown
Member

Entitlement validation currently adds every available on-demand CDI kind to a build device requests, even when the build requested an unrelated device. It also replaces the original requests with bare kind names, losing selectors such as =all and the optional flag. Required requests have the opposite problem where validation tries to resolve them before setup has registered the devices, so they fail with "required device … is not registered" without reaching the installer. This change retains only matching requests and preserves their names until setup completes. Explicit grants for on-demand kinds also stop failing premature resolution when a build requests registered devices alongside them. Existing permission checks for installed devices remain unchanged.

Only include on-demand devices requested by the build, preserving their
names, selectors, and optional flags. Defer resolution until setup has
registered the devices so required requests can reach the installer.

Skip unresolved on-demand kinds when checking explicit grants alongside
registered devices. Keep permission checks for installed devices intact.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max
crazy-max force-pushed the fix-cdi-on-demand-resolution branch from b675c35 to 016bab5 Compare October 17, 2026 14:50
@crazy-max crazy-max added this to the v0.35.0 milestone Oct 17, 2026
@crazy-max
crazy-max requested a review from tonistiigi October 19, 2026 08:38
@crazy-max
crazy-max marked this pull request as ready for review October 19, 2026 08:38

@tonistiigi tonistiigi left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend picking 27d91de

Resolve registered class matches before deferring on-demand devices,
and enforce their device permissions. Ignore nil device requests.
Add regression coverage for denied matches and explicit grants.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max

Copy link
Copy Markdown
Member Author

Recommend picking 27d91de

Yes I missed the class-annotation fallback

@crazy-max
crazy-max requested a review from tonistiigi October 21, 2026 09:18
@tonistiigi
tonistiigi merged commit 1415168 into moby:master Oct 21, 2026
281 of 285 checks passed
@crazy-max
crazy-max deleted the fix-cdi-on-demand-resolution branch October 22, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants